package com.zstu.mall.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.zstu.mall.common.BaseEntity;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.*;

/**
 * @author     : wuyc
 * @description: product_activity
 * @date       : Created in 2019/11/24
 */
@Entity
//防止序列化问题
@JsonIgnoreProperties({ "handler","hibernateLazyInitializer" })
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@Table(name = "product_activity")
public class ProductActivity extends BaseEntity implements Serializable {

	/**
	 * null
	 * default value: null
	 */
	@Column(name = "activity", nullable = false,length = 255)
	private String activity;

	/**
	 * null
	 * default value: null
	 */
	@Column(name = "image", nullable = false,length = 255)
	private String image;

	/**
	 * 活动栏目
	 * default value: '0'
	 */
	@Column(name = "column_id", nullable = false,length = 255)
	private String columnId;

	/**
	 * 折扣
	 * default value: 0
	 */
	@Column(name = "discount", nullable = false,length = 50)
	private Double discount;

	/**
	 * 活动满足金额
	 * default value: 0
	 */
	@Column(name = "mix_amount", nullable = false,length = 50)
	private Double mixAmount;

	/**
	 * 所属店铺
	 * default value: ' '
	 */
	@Column(name = "shop_id", nullable = false,length = 255)
	private String shopId;

	/**
	 * 备用
	 * default value: ' '
	 */
	@Column(name = "string1", nullable = false,length = 255)
	private String string1;

	/**
	 * 备用
	 * default value: ' '
	 */
	@Column(name = "string2", nullable = false,length = 255)
	private String string2;

	/**
	 * 备用
	 * default value: ' '
	 */
	@Column(name = "string3", nullable = false,length = 255)
	private String string3;

	@Transient
	private ActivityColumn activityColumn;

	@Transient
	private List<Product> products;

	public List<Product> getProducts() {
		return products;
	}

	public void setProducts(List<Product> products) {
		this.products = products;
	}

	public ActivityColumn getActivityColumn() {
		return activityColumn;
	}

	public void setActivityColumn(ActivityColumn activityColumn) {
		this.activityColumn = activityColumn;
	}

	public ProductActivity() {
		super();
		super.status = "1";
		super.remark = " ";
		super.gmtCreate = new Date();
		super.gmtModified = new Date();
		this.activity = null;
		this.columnId = "0";
		this.discount = 0.0;
		this.mixAmount = 0.0;
		this.shopId = " ";
		this.string1 = " ";
		this.string2 = " ";
		this.string3 = " ";
		this.image = " ";
	}

	public String getActivity() {
		return this.activity;
	}
	
	public void setActivity(String activity) {
		this.activity = activity;
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	public String getColumnId() {
		return this.columnId;
	}
	
	public void setColumnId(String columnId) {
		this.columnId = columnId;
	}
	
	public Double getDiscount() {
		return this.discount;
	}
	
	public void setDiscount(Double discount) {
		this.discount = discount;
	}
	
	public Double getMixAmount() {
		return this.mixAmount;
	}
	
	public void setMixAmount(Double mixAmount) {
		this.mixAmount = mixAmount;
	}
	
	public String getShopId() {
		return this.shopId;
	}
	
	public void setShopId(String shopId) {
		this.shopId = shopId;
	}
	
	public String getString1() {
		return this.string1;
	}
	
	public void setString1(String string1) {
		this.string1 = string1;
	}
	
	public String getString2() {
		return this.string2;
	}
	
	public void setString2(String string2) {
		this.string2 = string2;
	}
	
	public String getString3() {
		return this.string3;
	}
	
	public void setString3(String string3) {
		this.string3 = string3;
	}

	@Override
	public String toString() {
		return "ProductActivity{" +
				"activity='" + activity + '\'' +
				", columnId='" + columnId + '\'' +
				", discount=" + discount +
				", mixAmount=" + mixAmount +
				", shopId='" + shopId + '\'' +
				", string1='" + string1 + '\'' +
				", string2='" + string2 + '\'' +
				", string3='" + string3 + '\'' +
				", activityColumn=" + activityColumn +
				", id='" + id + '\'' +
				", gmtCreate=" + gmtCreate +
				", gmtModified=" + gmtModified +
				", status='" + status + '\'' +
				", remark='" + remark + '\'' +
				'}';
	}

}
